<!DOCTYPE html>
<html>
  <head>
    <title><%= full_title(yield(:title)) %></title>
    <%= csrf_meta_tags %>
    <%= csp_meta_tag %>
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
    <%= javascript_include_tag "application" %>
    <%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track': 'reload' %>
    <%= javascript_pack_tag 'application', 'data-turbolinks-track': 'reload' %>
  </head>
  <body>
  <div>
    <div id="nstru">
      <div id="notice">
        <span id="notcon">
          <% flash.each do |message_type, message| %>
          <div><%= message %></div>
          <% end %>
        </span>
        <span id="closenot" title="关闭" onclick="nothidden()">×</span>
      </div>
      <div id="notline"></div>
      </div>
    <div id="header">
      <div class="flex">
        <div class="left"><%= link_to "Ray's Site", root_path, class:"logo"%></div>
        <div class="search flex right">
          <span id="like" onclick="like(window.location.href)" title="喜欢！">❤</span>
          <input id="sinput" placeholder="搜索" onfocus="javascript:searchf('focus')" onblur="javascript:searchf('blur')">
        </div>
      </div>
    </div>
    <div class="headerline"></div>
    <div id="main">
      <div class="container">
        <div class="list">
          <div class="conl">
           <%= yield %>
           </div>
        </div>
        <div class="sidebar">
          <div class="concard sb">
              <div class="sbbo">
              <% if logged_in? %>
                欢迎您，<b><%= current_user.name %></b>
              <% else %>
                <b>登入，与我们一同交流</b>
              <% end %>
                <div class="su" id="su">
                  <%= render 'shared/route' %>
                </div>
              </div>
          </div>
          <div class="concard sb">
              <div class="sbti">标签</div>
              <div class="sbbo"><div id="tags">
              <% Tag.all.limit(10).each do | tag | %>
              <span class="tagsty"><%= tag.Title %></span>
              <% end %>
              </div></div>
          </div>
          <div class="concard sb">
              <div class="sbti">反馈</div>
              <div class="sbbo">
              <div id="email">
                  E-mail: <a href="mailto:eagle@purethis.com">eagle@purethis.com</a>
                </div>
              </div>
          </div>
        </div>
        </div>
    </div>
    <div class="footer">
      <div class="footerline"></div>
      <div class="fcon">
          <div>Powered by Ruby on Rails. </div>
          <div>Copyright © Ray's Site. All Rights Reserved. </div>
      </div>
    </div>
    <script>
      bonload();
    </script> 
  </body>
</html>